/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package UI;

import java.awt.Component;
import javax.swing.*;
import static javax.swing.GroupLayout.Alignment.*;

import javax.swing.*;


/**
 *
 * @author JASMINE
 */
public class BCaseInfoModify extends javax.swing.JFrame{

    final static boolean shouldFill = true;
    final static boolean shouldWeightX = true;
    final static boolean RIGHT_TO_LEFT = false;

    public BCaseInfoModify()
    {
        initCIM();
    }

    public static void main(String[] args)
    {
        try
        {
            //nt.join();
        }
        catch(Exception e)
        {}
        System.exit(1);
        System.out.printf("t");
        java.awt.EventQueue.invokeLater(new Runnable()
        {
            public void run()
            {

            }
        });
    }

/*
     public static void main(String args[])
     {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
        new BCaseInfoModify().setVisible(true);
            }
        });
     }

 *
 * 
 */

     private void initCIM()
     {
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setTitle("Dispatch Resources");
        this.setResizable(false);
        
        GroupLayout layout = new GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setAutoCreateGaps(true);
        layout.setAutoCreateContainerGaps(true);


        //CaseInfoPanel
        JPanel panelCaseInfo = new JPanel();
        panelCaseInfo.setPreferredSize(new java.awt.Dimension(500, 180));
        panelCaseInfo.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Case Information"));

        //DispatchResourcesPanel
        JPanel panelDispatchResources = new JPanel();
        panelDispatchResources.setPreferredSize(new java.awt.Dimension(500, 420));
        panelDispatchResources.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Dispatch Resources"));

        //SubPanel of CaseInfoPanel
        JLabel lblCIP1 = new JLabel();
        lblCIP1.setText("Location of Emergency: ");
        JLabel lblCIP2 = new JLabel();
        lblCIP2.setText("Type of Emergency: ");
        JLabel lblCIP3 = new JLabel();
        lblCIP3.setText("Degree of Seriousness: ");
        JLabel lblCIP4 = new JLabel();
        lblCIP4.setText("Description of Situation: ");

        JLabel lblCIP1a = new JLabel();
        lblCIP1a.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        lblCIP1a.setPreferredSize(new java.awt.Dimension(200, 18));

        JLabel lblCIP2a = new JLabel();
        lblCIP2a.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        lblCIP2a.setPreferredSize(new java.awt.Dimension(200, 18));

        JLabel lblCIP3a = new JLabel();
        lblCIP3a.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        lblCIP3a.setPreferredSize(new java.awt.Dimension(200, 18));

        JLabel lblCIP4a = new JLabel();
        lblCIP4a.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        lblCIP4a.setPreferredSize(new java.awt.Dimension(200, 36));
              
        javax.swing.GroupLayout caseInfoPanelLayout = new javax.swing.GroupLayout(panelCaseInfo);
        panelCaseInfo.setLayout(caseInfoPanelLayout);

        caseInfoPanelLayout.setHorizontalGroup(
            caseInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(caseInfoPanelLayout.createSequentialGroup()
                .addGap(40, 40, 40)
                .addGroup(caseInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblCIP4)
                    .addComponent(lblCIP3)
                    .addComponent(lblCIP2)
                    .addComponent(lblCIP1))
                .addGap(50, 50, 50)
                .addGroup(caseInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblCIP4a, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblCIP3a, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblCIP2a, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblCIP1a, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(279, Short.MAX_VALUE))
        );


        caseInfoPanelLayout.setVerticalGroup(
            caseInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(caseInfoPanelLayout.createSequentialGroup()
                //.addGap(0, 0, 0)
                .addGroup(caseInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblCIP1)
                    .addComponent(lblCIP1a, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(caseInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblCIP2)
                    .addComponent(lblCIP2a, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(caseInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblCIP3)
                    .addComponent(lblCIP3a, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(caseInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblCIP4)
                    .addComponent(lblCIP4a, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(91, Short.MAX_VALUE))
        );

        //SubPanel of DispatchResources
        //SubPanel-SubPanel1
        JPanel panelNull = new JPanel();

        JLabel lblSelectZone = new JLabel();
        lblSelectZone.setText("Select Zones: ");

        JComboBox cmbZones = new JComboBox();
        cmbZones.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        javax.swing.GroupLayout panelNullLayout = new javax.swing.GroupLayout(panelNull);
        panelNull.setLayout(panelNullLayout);

        panelNullLayout.setHorizontalGroup(
            panelNullLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelNullLayout.createSequentialGroup()
                //.addGap(30, 30, 30)
                .addGroup(panelNullLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblSelectZone))
                .addGap(65, 65, 65)
                .addGroup(panelNullLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(cmbZones))
                .addContainerGap(279, Short.MAX_VALUE))
        );

        panelNullLayout.setVerticalGroup(
            panelNullLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelNullLayout.createSequentialGroup()
                //.addGap(10, 10, 10)
                .addGroup(panelNullLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblSelectZone)
                    .addComponent(cmbZones)))
                //.addContainerGap(0, Short.MAX_VALUE))
        );

        //SubPanel-SubPanel2
        JPanel panelResources = new JPanel();
        panelResources.setPreferredSize(new java.awt.Dimension(240, 280));
        panelResources.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Resources"));

        JPanel panelFireEngines = new JPanel();
        panelFireEngines.setPreferredSize(new java.awt.Dimension(150, 200));
        panelFireEngines.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Fire Engines"));
// <editor-fold defaultstate="collapsed" desc="FireEngines Resources Available">
        String[] loc = {"CK", "YT", "JR", "BE"};
        String[] locNum = {"1", "2", "3", "4"};
        int locnumPairs = loc.length;
        //JPanel fireEnginesPanel = new JPanel(new SpringLayout());
        //fireEnginesPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Fire Engines"));

        GroupLayout panelFireEnginesLayout = new GroupLayout(panelFireEngines);
        panelFireEngines.setLayout(panelFireEnginesLayout);
  
        GroupLayout.ParallelGroup FEparGroup = panelFireEnginesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER );
        GroupLayout.ParallelGroup FEparGroup1 = panelFireEnginesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER );

        int x = 0;
        for (int i = 0; i < locnumPairs; i++)
        {
            GroupLayout.ParallelGroup tParGroup1 = panelFireEnginesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING);
            GroupLayout.ParallelGroup tParGroup2 = panelFireEnginesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING);

            
            JLabel lblLoc = new JLabel();
            lblLoc.setName("lblLoc"+i);
            lblLoc.setText(loc[i]);

            JLabel lblRavail = new JLabel();
            lblRavail.setName("lblRavail"+i);
            lblRavail.setText(locNum[i]);

            JTextField txtRequired = new JTextField();
            txtRequired.setName("txtRequired"+i);
            txtRequired.setPreferredSize(new java.awt.Dimension(20, 20));

            tParGroup1
            .addGroup(panelFireEnginesLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(panelFireEnginesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblLoc))
                .addGap(20, 20, 20)
                .addGroup(panelFireEnginesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblRavail))
                .addGap(30, 30, 30)
                .addGroup(panelFireEnginesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtRequired, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(279, Short.MAX_VALUE));


            tParGroup2
            .addGroup(panelFireEnginesLayout.createSequentialGroup()
                .addGap(5+x, 5+x, 5+x)
                .addGroup(panelFireEnginesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblLoc)
                    .addComponent(lblRavail)
                    .addComponent(txtRequired, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(15, 15, 15)
                .addContainerGap(91, Short.MAX_VALUE));

            FEparGroup.addGroup(tParGroup1);
            FEparGroup1.addGroup(tParGroup2);

            x = x +25;
        }

        panelFireEnginesLayout.setHorizontalGroup(FEparGroup);
        panelFireEnginesLayout.setVerticalGroup(FEparGroup1);
// </editor-fold>
        JPanel panelPolices = new JPanel();
        panelPolices.setPreferredSize(new java.awt.Dimension(150, 200));
        panelPolices.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Police"));
// <editor-fold defaultstate="collapsed" desc="Police Resources Available">

        String[] loc1 = {"CK", "YT", "JR", "BE"};
        String[] locNum1 = {"1", "2", "3", "4"};
        int locnumPairs1 = loc.length;
        //JPanel fireEnginesPanel = new JPanel(new SpringLayout());
        //fireEnginesPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Fire Engines"));

        GroupLayout panelPolicesLayout = new GroupLayout(panelPolices);
        panelPolices.setLayout(panelPolicesLayout);

        GroupLayout.ParallelGroup PparGroup = panelPolicesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER );
        GroupLayout.ParallelGroup PparGroup1 = panelPolicesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER );

        int x1 = 0;
        for (int i = 0; i < locnumPairs1; i++)
        {
            GroupLayout.ParallelGroup tParGroup1 = panelPolicesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING);
            GroupLayout.ParallelGroup tParGroup2 = panelPolicesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING);

            JLabel lblLoc1 = new JLabel();
            lblLoc1.setName("lblLoc"+i);
            lblLoc1.setText(loc1[i]);

            JLabel lblRavail1 = new JLabel();
            lblRavail1.setName("lblRavail"+i);
            lblRavail1.setText(locNum1[i]);

            JTextField txtRequired1 = new JTextField();
            txtRequired1.setName("txtRequired"+i);
            txtRequired1.setPreferredSize(new java.awt.Dimension(20, 20));

            tParGroup1
            .addGroup(panelPolicesLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(panelPolicesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblLoc1))
                .addGap(20, 20, 20)
                .addGroup(panelPolicesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblRavail1))
                .addGap(30, 30, 30)
                .addGroup(panelPolicesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtRequired1, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(279, Short.MAX_VALUE));


            tParGroup2
            .addGroup(panelPolicesLayout.createSequentialGroup()
                .addGap(5+x1, 5+x1, 5+x1)
                .addGroup(panelPolicesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblLoc1)
                    .addComponent(lblRavail1)
                    .addComponent(txtRequired1, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(15, 15, 15)
                .addContainerGap(91, Short.MAX_VALUE));

            PparGroup.addGroup(tParGroup1);
            PparGroup1.addGroup(tParGroup2);

            x1 = x1 +25;
        }

        panelPolicesLayout.setHorizontalGroup(PparGroup);
        panelPolicesLayout.setVerticalGroup(PparGroup1);

// </editor-fold>
        JPanel panelAmbulance = new JPanel();
        panelAmbulance.setPreferredSize(new java.awt.Dimension(150, 200));
        panelAmbulance.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Ambulance"));
// <editor-fold defaultstate="collapsed" desc="Ambulance Resources Available">
        String[] loc2 = {"CK", "YT", "JR", "BE"};
        String[] locNum2 = {"1", "2", "3", "4"};
        int locnumPairs2 = loc.length;

        GroupLayout panelAmbulanceLayout = new GroupLayout(panelAmbulance);
        panelAmbulance.setLayout(panelAmbulanceLayout);

        GroupLayout.ParallelGroup AparGroup = panelAmbulanceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER );
        GroupLayout.ParallelGroup AparGroup1 = panelAmbulanceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER );

        int x2 = 0;
        for (int i = 0; i < locnumPairs2; i++)
        {
            GroupLayout.ParallelGroup tParGroup1 = panelAmbulanceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING);
            GroupLayout.ParallelGroup tParGroup2 = panelAmbulanceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING);


            JLabel lblLoc2 = new JLabel();
            lblLoc2.setName("lblLoc"+i);
            lblLoc2.setText(loc2[i]);

            JLabel lblRavail2 = new JLabel();
            lblRavail2.setName("lblRavail"+i);
            lblRavail2.setText(locNum2[i]);

            JTextField txtRequired2 = new JTextField();
            txtRequired2.setName("txtRequired"+i);
            txtRequired2.setPreferredSize(new java.awt.Dimension(20, 20));

            tParGroup1
            .addGroup(panelAmbulanceLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(panelAmbulanceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblLoc2))
                .addGap(20, 20, 20)
                .addGroup(panelAmbulanceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblRavail2))
                .addGap(30, 30, 30)
                .addGroup(panelAmbulanceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtRequired2, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(279, Short.MAX_VALUE));


            tParGroup2
            .addGroup(panelAmbulanceLayout.createSequentialGroup()
                .addGap(5+x2, 5+x2, 5+x2)
                .addGroup(panelAmbulanceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblLoc2)
                    .addComponent(lblRavail2)
                    .addComponent(txtRequired2, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(15, 15, 15)
                .addContainerGap(91, Short.MAX_VALUE));

            AparGroup.addGroup(tParGroup1);
            AparGroup1.addGroup(tParGroup2);

            x2 = x2 +25;
        }

        panelAmbulanceLayout.setHorizontalGroup(AparGroup);
        panelAmbulanceLayout.setVerticalGroup(AparGroup1);
// </editor-fold>

        GroupLayout panelResourcesLayout = new GroupLayout(panelResources);
        panelResources.setLayout(panelResourcesLayout);

        panelResourcesLayout.setHorizontalGroup(
            panelResourcesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelResourcesLayout.createSequentialGroup()
                .addGap(5, 5, 5)
                .addComponent(panelFireEngines, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(panelPolices, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(panelAmbulance, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        panelResourcesLayout.setVerticalGroup(
            panelResourcesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelResourcesLayout.createSequentialGroup()
                .addGap(5, 5, 5)
                .addGroup(panelResourcesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(panelAmbulance, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(panelPolices, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(panelFireEngines, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(129, Short.MAX_VALUE))
        );

        //SubPanel-SubPanel3
        JPanel panelNull1 = new JPanel();

        JLabel lblAdditionalInformation = new JLabel();
        lblAdditionalInformation.setText("Additional Information:");

        JTextField txtAddInfo = new JTextField();
        txtAddInfo.setPreferredSize(new java.awt.Dimension(330, 100));

        JButton btnDispatch = new JButton();
        btnDispatch.setText("Dispatch");

        javax.swing.GroupLayout panelNull1Layout = new javax.swing.GroupLayout(panelNull1);
        panelNull1.setLayout(panelNull1Layout);
        //panelNull1.setPreferredSize(new java.awt.Dimension(400, 300));

        panelNull1Layout.setHorizontalGroup(
            panelNull1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelNull1Layout.createSequentialGroup()
                //.addGap(10, 10, 10)
                .addComponent(lblAdditionalInformation)
                .addGap(20, 20, 20)
                .addComponent(txtAddInfo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                //addContainerGap(0, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelNull1Layout.createSequentialGroup()
                //addContainerGap(250, Short.MAX_VALUE)
                .addComponent(btnDispatch))
                //.addContainerGap(0, Short.MAX_VALUE))
        );

        panelNull1Layout.setVerticalGroup(
            panelNull1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelNull1Layout.createSequentialGroup()
                //.addContainerGap()
                .addGroup(panelNull1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblAdditionalInformation)
                    .addGroup(panelNull1Layout.createSequentialGroup()
                        .addComponent(txtAddInfo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)
                        .addComponent(btnDispatch))))
                //addContainerGap(10, Short.MAX_VALUE))
        );

         //Add all Panel to the dispatchResourcesPanel
        javax.swing.GroupLayout panelDispatchResourcesLayout = new javax.swing.GroupLayout(panelDispatchResources);
        panelDispatchResources.setLayout(panelDispatchResourcesLayout);

        panelDispatchResourcesLayout.setHorizontalGroup(
            panelDispatchResourcesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelDispatchResourcesLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(panelDispatchResourcesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(panelNull1)
                    .addComponent(panelResources)
                    .addComponent(panelNull)))
                //addContainerGap(10, Short.MAX_VALUE))
        );

         panelDispatchResourcesLayout.setVerticalGroup(
            panelDispatchResourcesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelDispatchResourcesLayout.createSequentialGroup()
                .addGap(0, 0, 0)
                .addGroup(panelDispatchResourcesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(panelNull))
                .addGap(15, 15, 15)
                .addGroup(panelDispatchResourcesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(panelResources))
                .addGap(20, 20, 20)
                .addGroup(panelDispatchResourcesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(panelNull1)))
                //.addContainerGap(0, Short.MAX_VALUE))
        );

        //ADDING FINAL LAYOUT(the two main panels) TO THE FRAME
        layout.setHorizontalGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(LEADING)
                .addComponent(panelCaseInfo)
                .addComponent(panelDispatchResources))
        );

        layout.setVerticalGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(BASELINE)
                .addComponent(panelCaseInfo))
            .addGroup(layout.createParallelGroup(LEADING)
                .addComponent(panelDispatchResources))
        );

        pack();
     }
     }

